﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Media;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using System.IO;

namespace HotelBookingSystem.DataBaseStuff
{
    class ResultRoom
    {
        public List<RoomInfo> roomTree;
        public string menuItem;
        //string roomType;
        public ResultRoom(List<RoomInfo> roomTree, string menuItem)//, string roomType)
        {
            this.roomTree = roomTree;
            this.menuItem = menuItem;
            //this.roomType = roomType;
        }
    }

    struct RoomInfo
    {
        public uint roomNumber;
        public uint currentPeriod;
        public uint periodsTillNow;
        public RoomInfo(uint roomNumber, uint currentPeriod, uint periodsTillNow)
        {
            this.roomNumber = roomNumber;
            this.currentPeriod = currentPeriod;
            this.periodsTillNow = periodsTillNow;
        }
    }

    class _Room
    {
        public List<DateTime> startDates;
        public List<DateTime> endDates;
        public bool full;
        public _Room()
        {
            full = false;
            startDates = new List<DateTime>();
            endDates = new List<DateTime>();
            int periods = MyRandom.RanNum(0, 3);
            if (periods == 0)
            {
                full = true; return;
            }
            int monthDay = MyRandom.RanNum(120, 150);
            for (int i = 0; i < periods; i++)
            {
                int dur = MyRandom.RanNum(3, 10);
                startDates.Add(GetDate(monthDay));
                endDates.Add(startDates[i].AddDays(dur));
                monthDay += dur + 1;
            }
            monthDay = MyRandom.RanNum(monthDay, monthDay + 30);
        }

        private DateTime GetDate(int monthDay)
        {
            return (new DateTime(2013, 1, 1).AddDays(monthDay));
        }

    }

}